/**
 *
 */
package com.jycode.commons.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.jycode.commons.genericdao.GenericHibernateDAO;
import com.jycode.commons.model.SysRole;

/**
 * @author "banlyst <banlyst@gmail.com>"
 *
 */
@Repository("sysRoleDAO")
public class SysRoleDAOImpl extends GenericHibernateDAO<SysRole, Long> implements SysRoleDAO {

	/**
	 * @param persistentClass
	 */
	public SysRoleDAOImpl() {
		super(SysRole.class);
	}

	public SysRole findByName(String name) {
		return uniqueResult(findByNamedQuery("findByName", name));
	}

	public List<SysRole> findByParentRoleId(Long parentId) {
		return findByNamedQuery("findByParentRoleId", parentId);
	}


}
